<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            padding: 15px;
            border: 5px solid purple;
            margin: 10px 0;
        }
        .w200{
            width: 200px;
        }
        .w-p40{
            width: 40%;
        }
        .wrapper {
            width: 600px;
            padding: 15px 0;
            border-color: #040489;
        }
    </style>
</head>
<body>
    <div class="w200">我的宽度为200px</div>
    <div class="w-p40">我的宽度为40%</div>
    <div class="wrapper">
        <div class="w200">我的宽度为200px</div>
        <div class="w-p40">我的宽度为40%</div>
    </div>
</body>
</html>